const baseUrl = "http://172.81.243.51:4000/"

export const get = async (url) => {
    try {
        let response = await fetch(baseUrl + url)
        let responseJson = await response.json()
        return responseJson
    } catch (error) {
        alert.error(error)
    }
}

export const post = async (url, requestData) => {
    try {
        let response = await fetch(baseUrl + url, {
            method: 'POST',
            headers: {
                "Content-Type": "application/json"
            },
            body: JSON.stringify(requestData)
        })
        let responseJson = await response.json()
        return responseJson
    } catch (error) {
        alert.error(error)
    }
}